package com.agan.common.core.param;


import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;

import java.util.Map;
import java.util.Objects;

public class PageCommonParam {
    /**
     * 当前页码
     */
    protected Integer pageNum;

    /**
     * 每页显示条数
     */
    protected Integer pageSize;

    /**
     * 数据范围
     */
    protected String dataScope;

    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    @TableField(exist = false)
    private Map<String, Object> params;

    public Map<String, Object> getParams() {
        return params;
    }

    public void setParams(Map<String, Object> params) {
        this.params = params;
    }

    public Integer getPageNum() {
        return Objects.isNull(pageNum) ? 1 : pageNum;
    }

    public Integer getPageSize() {
        return Objects.isNull(pageSize) ? 10 : pageSize;
    }

    public void setPageNum(Integer pageNum) {
        this.pageNum = pageNum;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public String getDataScope() {
        return dataScope;
    }

    public void setDataScope(String dataScope) {
        this.dataScope = dataScope;
    }
}
